<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Xinc Guide - Publishers</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <link rel="Stylesheet" rev="Stylesheet" href="../../css/Documentation.css" type="text/css" media="All" charset="iso-8859-1" />
</head>
<body>
<h1><a name="AppendixB"></a>Appendix D: Publishers</h1>

<p>
This appendix contains a reference of all publisher tasks, i.e. all
tasks that can run publish scripts after a Xinc build.
</p>
<h2><a name="PhingpublisherTask"></a>&lt;phingpublisher/&gt;</h2>
<p></p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
  <li>&lt;<a href="#OnsuccessTask">onsuccess</a>/&gt;</li>
  <li>&lt;<a href="#OnfailureTask">onfailure</a>/&gt;</li>
  <li>&lt;<a href="#OnrecoveryTask">onrecovery</a>/&gt;</li>
</ul>
<pre title="Example of how to use PhingpublisherTask">
&lt;project name=&quot;ProjectName&quot;&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>&gt;
        &lt;phingpublisher buildfile=&quot;build.xml&quot; target=&quot;main&quot;/&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will execute the Phing publish script "build.xml" and call the target "main".
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
      <th>Required</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>buildfile</td>
      <td>String</td>
      <td>Filename of the Phing buildfile</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
     <tr>
      <td>target</td>
      <td>String</td>
      <td>Target inside the Phing buildscript which shall be called</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
    <tr>
      <td>params</td>
      <td>String</td>
      <td>Extra parameters which will be passed to phing when executing it from the command line</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
    <tr>
      <td>workingdir</td>
      <td>String</td>
      <td>Setting the working directory before executing Phing</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
  </tbody>
</table>
<p>
<strong>
All Properties that are available in Xinc will be passed to the Phing buildscript with the prefix "xinc.".
<br/>
<p><strong>Example:</strong><br/>
build.number => xinc.build.number
</p>

</strong>
</p>
<p>&nbsp;</p>
<h2><a name="EmailTask"></a>&lt;email/&gt;</h2>
<p></p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
  <li>&lt;<a href="#OnsuccessTask">onsuccess</a>/&gt;</li>
  <li>&lt;<a href="#OnfailureTask">onfailure</a>/&gt;</li>
  <li>&lt;<a href="#OnrecoveryTask">onrecovery</a>/&gt;</li>
</ul>
<pre title="Example of how to use EmailTask">
&lt;project name=&quot;ProjectName&quot;&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>&gt;
        &lt;email to=&quot;someone@email.com&quot; subject=&quot;build executed&quot; 
             message=&quot;Build of project was executed&quot;/&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will send an email after each build.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
      <th>Required</th>
    </tr>
  </thead>
  <tbody>
  <tr>
      <td>to</td>
      <td>String</td>
      <td>Name of receiver</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
    <tr>
      <td>subject</td>
      <td>String</td>
      <td>Subject of the email</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
    <tr>
      <td>message</td>
      <td>String</td>
      <td>Content of the email</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
    <tr>
      <td>from</td>
      <td>String</td>
      <td>Name of sender</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
     
  </tbody>
</table>
<p>&nbsp;</p>
<h2><a name="ArtifactspublisherTask"></a>&lt;artifactspublisher/&gt;</h2>
<p></p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
  <li>&lt;<a href="#OnsuccessTask">onsuccess</a>/&gt;</li>
  <li>&lt;<a href="#OnfailureTask">onfailure</a>/&gt;</li>
  <li>&lt;<a href="#OnrecoveryTask">onrecovery</a>/&gt;</li>
</ul>
<pre title="Example of how to use ArtifactsPublisherTask">
&lt;project name=&quot;ProjectName&quot;&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>&gt;
        &lt;artifactspublisher file=&quot;${dir}/report.html&quot;/&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will register the build artifact "report.html" with the build and make it available on the web interface.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
      <th>Required</th>
    </tr>
  </thead>
  <tbody>
  <tr>
      <td>file</td>
      <td>String</td>
      <td>File or Directory within the project directory</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>

<h2><a name="DeliverableTask"></a>&lt;deliverable/&gt;</h2>
<p></p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
  <li>&lt;<a href="#OnsuccessTask">onsuccess</a>/&gt;</li>
  <li>&lt;<a href="#OnfailureTask">onfailure</a>/&gt;</li>
  <li>&lt;<a href="#OnrecoveryTask">onrecovery</a>/&gt;</li>
</ul>
<pre title="Example of how to use ArtifactsPublisherTask">
&lt;project name=&quot;ProjectName&quot;&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>&gt;
        &lt;deliverable file=&quot;${dir}/build-${build.number}.tar&quot;
             alias=&quot;build.latest.tar&quot;/&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will register the tarball "build-${build.number}.tar" with the build and make it available on the web interface for download.<br/>
Since ${build.number} is variable it also sets an alias "build.latest.tar" under which the file can be downloaded.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
      <th>Required</th>
    </tr>
  </thead>
  <tbody>
  <tr>
      <td>file</td>
      <td>String</td>
      <td>Filename of the deliverable</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
    <tr>
      <td>alias</td>
      <td>String</td>
      <td>Alias for the deliverable</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
<h2><a name="DocumentationTask"></a>&lt;documentation/&gt;</h2>
<p></p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
  <li>&lt;<a href="#OnsuccessTask">onsuccess</a>/&gt;</li>
  <li>&lt;<a href="#OnfailureTask">onfailure</a>/&gt;</li>
  <li>&lt;<a href="#OnrecoveryTask">onrecovery</a>/&gt;</li>
</ul>
<pre title="Example of how to use DocumentationTask">
&lt;project name=&quot;ProjectName&quot;&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>&gt;
        &lt;documentation file=&quot;${dir}/phpdoc&quot;
             alias=&quot;PHPDoc Documentation&quot; 
             index=&quot;${dir}/phpdoc/index.html&quot;/&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will register the directory "${dir}/phpdoc" with the build as a documentation package and make it available on the web interface for viewing.<br/>
It will appear as "PHPDoc Documentation".<br/>
The first page loaded will be "index.html".
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
      <th>Default</th>
      <th>Required</th>
    </tr>
  </thead>
  <tbody>
  <tr>
      <td>file</td>
      <td>String</td>
      <td>Filename/Folder name of the documentation</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
    <tr>
      <td>alias</td>
      <td>String</td>
      <td>Alias for the documentation package</td>
      <td>n/a</td>
      <td>No</td>
    </tr>
    <tr>
      <td>index</td>
      <td>String</td>
      <td>Index File to load as first page of the documentation</td>
      <td>n/a</td>
      <td>Yes</td>
    </tr>
  </tbody>
</table>
<p>&nbsp;</p>
<h2><a name="OnsuccessTask"></a>&lt;onsuccess/&gt;</h2>
<p> The onsuccess publisher will only execute the children publishers if the build was successful.</p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
</ul>
<pre title="Example of how to use OnsuccessTask">
&lt;project name=&quot;ProjectName&quot;&gt;
    &lt;<a href="AppendixB-CoreTasks.html#ScheduleTask">schedule</a> interval=&quot;240&quot;/&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#ModificationSetTask">publishers</a>&gt;
        &lt;onsuccess&gt;
            &lt;<a href="#EmailTask">email</a> to=&quot;someone@email.com&quot; subject=&quot;build success&quot; 
              message=&quot;Build of project was successful&quot;/&gt;
        &lt;/onsuccess&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will send an email with the subject "build success" only if the build was successful.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>None</th>
      
    </tr>
  </thead>
  <tbody>
    
  </tbody>
</table>
<h3>Supported Nested Tags</h3>
<ul>
  <li>All Publishers except: &lt;<a href="OnsuccessTask">onsuccess</a>&gt;,&lt;<a href="OnfailureTask">onfailure</a>&gt;,&lt;<a href="OnrecoveryTask">onrecovery</a>&gt;</li>
</ul>
<p>&nbsp;</p>
<h2><a name="OnfailureTask"></a>&lt;onfailure/&gt;</h2>
<p> The onfailure publisher will only execute the children publishers if the build failed.</p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
</ul>
<pre title="Example of how to use OnsuccessTask">
&lt;project name=&quot;ProjectName&quot;&gt;
    &lt;<a href="AppendixB-CoreTasks.html#ScheduleTask">schedule</a> interval=&quot;240&quot;/&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#ModificationSetTask">publishers</a>&gt;
        &lt;onfailure&gt;
            &lt;<a href="#EmailTask">email</a> to=&quot;someone@email.com&quot; subject=&quot;build failed&quot; 
              message=&quot;Build of project failed&quot;/&gt;
        &lt;/onfailure&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will send an email with the subject "build failed" only if the build failed.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>None</th>
      
    </tr>
  </thead>
  <tbody>
    
  </tbody>
</table>
<h3>Supported Nested Tags</h3>
<ul>
  <li>All Publishers except: &lt;<a href="OnsuccessTask">onsuccess</a>&gt;,&lt;<a href="OnfailureTask">onfailure</a>&gt;,&lt;<a href="OnrecoveryTask">onrecovery</a>&gt;</li>
</ul>
<p>&nbsp;</p>
<h2><a name="OnrecoveryTask"></a>&lt;onrecovery/&gt;</h2>
<p> The onrecovery publisher will only execute the children publishers if the build was successful after having failed before.</p>
<h3>Parent Tags</h3>
<ul>
  <li>&lt;<a href="AppendixB-CoreTasks.html#PublishersTask">publishers</a>/&gt;</li>
</ul>
<pre title="Example of how to use OnsuccessTask">
&lt;project name=&quot;ProjectName&quot;&gt;
    &lt;<a href="AppendixB-CoreTasks.html#ScheduleTask">schedule</a> interval=&quot;240&quot;/&gt;
...
    &lt;<a href="AppendixB-CoreTasks.html#ModificationSetTask">publishers</a>&gt;
        &lt;onrecovery&gt;
            &lt;<a href="#EmailTask">email</a> to=&quot;someone@email.com&quot; subject=&quot;build recovered&quot; 
              message=&quot;Build of project was recovered&quot;/&gt;
        &lt;/onrecovery&gt;
    &lt;/publishers&gt;
...
&lt;/project&gt;
</pre>
<p>
The above example will send an email with the subject "build recovered" only if the build was successful after having failed before.
</p>
<h3>Parameters</h3>
<table>
  <thead>
    <tr>
      <th>None</th>
      
    </tr>
  </thead>
  <tbody>
    
  </tbody>
</table>
<h3>Supported Nested Tags</h3>
<ul>
  <li>All Publishers except: &lt;<a href="OnsuccessTask">onsuccess</a>&gt;,&lt;<a href="OnfailureTask">onfailure</a>&gt;,&lt;<a href="OnrecoveryTask">onrecovery</a>&gt;</li>
</ul>
<p>&nbsp;</p>
</body>
</html>
